class FruitBox extends Fruit {
    private List<Fruit> fruits = new ArrayList<>();

    public void add(Fruit fruit) {
        fruits.add(fruit);
    }

    public void remove(Fruit fruit) {
        fruits.remove(fruit);
    }

    @Override
    public void eat() {
        System.out.println("打开礼盒");
        for (Fruit fruit : fruits) {
            fruit.eat();
        }
        System.out.println("礼盒已空\n");
    }
}